import request from './index'

export function getVideoData(params = 0) {
  return request.get({
    url: '/top/mv',
    data: {
      limit: 10, // 每次获取几条
      offset: params // 偏移量，之前获取了几条
    }
  })
} // 视频页接口

export function getVideoDetail(mvid) {
  return request.get({
    url: `/mv/detail`,
    data: {
      mvid
    }
  })
}
export function getVideoUrl(id) {
  return request.get({
    url: `/mv/url`,
    data: {
      id
    }
  })
}
export function getOtherVideo(id) {
  return request.get({
    url: `/related/allvideo`,
    data: {
      id
    }
  })
}
export function getBanner() {
  return request.get({
    url: '/banner',
    data: {
      type: 2
    }
  })
} // 获取轮播图

export function getRankings(idx) {
  return request.get({
    url: '/toplist',
    data: {
      idx
    }
  })
} // 获取排行榜
export function getHotSongsList() {
  return request.get({url:'/playlist/hot'})
}

export function getTopPlayList(cat = "全部", limit = 6, offset = 0) {
  return request.get({
    url: `/top/playlist`,
    data: {
      cat,
      limit,
      offset
    }
  })
} // 获取歌单
export function getSongListDetail(id) {
  return request.get({
    url: '/playlist/detail/dynamic',
    data: {
      id
    }
  })
} // 获取歌单详情

export function searchHot() {
  return request.get({
    url: `/search/hot`
  })
} // 获取热门关键字

export function getSearchSuggest(keywords) {
  return request.get({
    url: `/search/suggest`,
    data: {
      keywords,
      type: 'mobile'
    }
  })
} // 获取搜索建议数组

export function getSearchResult(keywords) {
  return request.get({
    url: `/search`,
    data: {
      keywords
    }
  })
} // 获取搜索结果

export function getMusicInfo(ids) {
  return request.get({
    url: `/song/detail`,
    data: {
      ids
    }
  })
} // 获取歌曲信息

export function getMusicLyric(id) {
  return request.get({
    url: `/lyric`,
    data: {
      id
    }
  })
} // 获取歌词信息

// export function getMusicPlayUrl() {
//   return request.get({
//     url: ``,
//     data: {

//     }
//   })
// } // 获取歌曲播放接口